package com.arch.dev.client.view;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.Widget;

public class FilterDataView extends Composite{
	@UiField	
	public RadioButton allRadioButton;
	@UiField
	public RadioButton dateRadioButton;
	@UiField
	public RadioButton monthRadioButton;
	@UiField
	public RadioButton yearRadioButton;

	private static FilterDataViewUiBinder uiBinder = GWT
			.create(FilterDataViewUiBinder.class);
	
	interface FilterDataViewUiBinder extends UiBinder<Widget, FilterDataView> {
	}
	
	public FilterDataView() {
		initWidget(uiBinder.createAndBindUi(this));
		allRadioButton.setValue(true, true);
	}

	public void addAllRadioButtonValueChangeHandler(ValueChangeHandler<Boolean> handler){
		allRadioButton.addValueChangeHandler(handler);
	}
	
	public void addDateRadioButtonValueChangeHandler(ValueChangeHandler<Boolean> handler){
		dateRadioButton.addValueChangeHandler(handler);
	}

	public void addMonthRadioButtonValueChangeHandler(ValueChangeHandler<Boolean> handler){
		monthRadioButton.addValueChangeHandler(handler);
	}
	
	public void addYearRadioButtonValueChangeHandler(ValueChangeHandler<Boolean> handler){
		yearRadioButton.addValueChangeHandler(handler);
	}

}
